package com.kaishengit.web;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kaishengit.entity.User;
import com.kaishengit.service.UserService;

public class NewProject extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
			
		doPost(request,response);
	
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		
		request.setCharacterEncoding("UTF-8");
		String state = request.getParameter("state");
		
		UserService userService = new UserService();
		
		List<User> list = userService.findAll();
		request.setAttribute("list", list);
		request.setAttribute("state", state);
		request.getRequestDispatcher("WEB-INF/views/newproject.jsp").forward(request, response);	
	
	}

	
	public void init() throws ServletException {
		// Put your code here
	}

}
